#pragma once

#pragma comment(lib,"dxgi.lib")
#pragma comment(lib,"d3d11.lib")

#include <dxgi.h>
#include <d3dcommon.h>
#include <d3d11.h>
#include <string>
#include <DirectXMath.h>
#include "../../Objects/GameObject.h"
class DirectXClass
{
protected:
	bool verticalSynchronizationEnabled;
	int videoCardMemory;
	std::string videoCardDescription;
	IDXGISwapChain* swapChain;
	ID3D11Device* device;
	ID3D11DeviceContext* deviceContext;
	ID3D11RenderTargetView* renderTargetView;
	ID3D11Texture2D* depthStencilBuffer;
	ID3D11DepthStencilState* depthStencilState;
	ID3D11DepthStencilView* depthStencilView;
	ID3D11RasterizerState* m_wireframeRasterState;
	ID3D11RasterizerState* m_solidRasterState;
	DirectX::XMMATRIX projectionMatrix;
	DirectX::XMMATRIX orthoMatrix;
public:
	struct DirectXVertexType
	{
		DirectX::XMFLOAT3 directXPositionLocal;
		DirectX::XMFLOAT3 directXNormalLocal;
		DirectX::XMFLOAT2 directXUVCoordinate;
	};
	DirectXClass();
	~DirectXClass();
	bool Initialize(int _screenHeight,int _screenWidth,bool _verticalSynchronizationEnabled, bool using4XMSAA, bool _fullScreen,HWND hwnd, float _screenDepth, float _screenNear);
	void Shutdown();
	void BeginScene(float red, float green, float blue, float alpha);
	void EndScene();
	ID3D11Device* GetDevice();
	ID3D11DeviceContext* GetDeviceContext();
	DirectX::XMMATRIX GetProjectionMatrix();
	DirectX::XMMATRIX GetOrthoMatrix();
	std::string GetVideoCardDesCription();
	int GetVideoCardMemory();
	void SetRasterizerState(bool wireframeMode);
	void CreateRenderingBuffer(GameObject* gameObject);
	void CreateTexture(GameObject* gameObject);//If not using some of the texture types, specify empty string.
};